package com.toweave.starter;

import android.app.Application;
import android.content.Context;
import android.view.WindowManager;

import com.toweave.starter.utils.DisplayUtil;

public class AsApplication  extends Application {
  // 共享数据
  private String sharedData;
  private float density;

  // getter setter 方法
  public String getSharedData() {
    return sharedData;
  }

  public void setSharedData(String sharedData) {
    this.sharedData = sharedData;
  }


  // AsApplication app = (AsApplication) context.getApplicationContext();
  // float density1 = app.getDensity();
  // Log.i(LIZ_TAG, "density: " + density1);

  public float getDensity() {
    return density;
  }

  public void setDensity(float density) {
    this.density = density;
  }



  @Override
  public void onCreate() {
    super.onCreate();
    // WindowManager windowManager = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
    float density = DisplayUtil.getDensity(this);
    setDensity(density);
    DisplayUtil.getMeta(this);
  }
}